<!-- HTML5文件 -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
		<title>微信绑定注册页</title>
		<link rel="stylesheet" href="assets/agile/css/agile.layout.css">
		<link rel="stylesheet" href="assets/agile/css/flat/flat.component.css">
		<link rel="stylesheet" href="assets/agile/css/flat/flat.color.css">
		<link rel="stylesheet" href="assets/agile/css/flat/iconline.css">
		<link rel="stylesheet" href="assets/agile/css/flat/iconform.css">
		<link rel="stylesheet" href="assets/component/timepicker/timepicker.css">
		<link rel="stylesheet" href="assets/app/css/app.css">
		<link rel="stylesheet" href="assets/my/common/style.css" />
	</head>
	<body>
		<div id="section_container">
			<section id="form_section" data-role="section" class="active">
				<header>
					<div class="titlebar">
				    	<a data-toggle="back" href="#"><i class="iconfont iconline-arrow-left"></i></a>
						<h1 class="title">更改密码</h1>
					</div>

				</header>

				<article data-role="article" id="article" data-scroll="verticle" class="active" style="top:44px;bottom:50px;">
					<div class="scroller">
						<form autocomplete="off" class="form-common">
							<br/>
							<br/>
							<br/>
							<label class="label-left">新密码:</label>
							<label class="label-right">
								<input id="newpwd" type="text" placeholder="请输入新密码"/>
							</label>
							<hr/>
							<label class="label-left">旧密码:</label>
							<label class="label-right">
								<input id="pwd" type="text"/>
							</label>
							<hr/>
							
							<br/>
							<br/>
							<br/>
							<button class="block submit" id="changeBTN">更改</button>
							<br/>
						</form>
					</div>
				</article>
			</section>
		</div>
		
		<!--- third --->
		<script src="assets/third/zepto/zepto.min.js"></script>
		<script src="assets/third/iscroll/iscroll-probe.js"></script>
		<script src="assets/third/arttemplate/template-native.js"></script>
		<!-- agile -->
		<script type="text/javascript" src="assets/agile/js/agile.js"></script>		
		<!--- bridge --->
		<script type="text/javascript" src="assets/bridge/exmobi.js"></script>
		<script type="text/javascript" src="assets/bridge/agile.exmobi.js"></script>
		<!-- app -->
		<script src="assets/component/timepicker/agile.timepicker.js"></script>	
		<script type="text/javascript" src="assets/component/extend.js"></script>
		<script type="text/javascript" src="assets/app/js/app.js"></script>
		<!-- my -->
		<script type="text/javascript" src="assets/my/common/my.js"></script>
		<script>
		if(! getCookie("UserID")>0){//进行登陆判断,是否有相应的cookie
			A.alert('错误','请先进行登陆操作',function(){
			    A.Controller.html("login.html"); 
			});
		}
		//点击更改按钮
		$('#changeBTN').on(A.options.clickEvent,function(){
			var newpwd = $('#newpwd').val();
			var pwd = $('#pwd').val();
			if(!newpwd){
				A.alert('提示','新密码不能为空');
			}else if(!pwd){
				A.alert('提示','请填写旧密码');
			}else{
				var _url=encodeURIComponent("http://182.92.241.133:8001/API/FrontBackInf/UpdatePwd?userID="+getCookie("UserID")+"&pwd="+pwd+"&NewPwd="+newpwd);
				myAjax(_url,regOk);//进行跨域请求json
			}
			return false;
		});
		function regOk(json){
			A.showToast('密码修改成功!');
			setTimeout(function() {
					A.Controller.back();
				},2500);
		}
		</script>
		
	</body>
</html>